# 分页器导包 两种
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.pagination import PageNumberPagination


class ArticleLimitOffsetPagination(LimitOffsetPagination):
    default_limit = 3  # 默认每页显示多少条数据
    max_limit = 20  # 最大每页显示多少条数据 前端接口可以配置
#     http://127.0.0.1:8000/community/articles/?limit=5&offset=1


class ArticlePageNumberPagination(PageNumberPagination):
    page_size = 3
    max_page_query_param = 'size'
    max_page_size = 20
